<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>陶票票在线购票系统</title>
    <style>
        #title{text-align: center}
        #tcdl{text-align: right}
    </style>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css"
          integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
            integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
</head>
<body>
<h3 id="tcdl"><a href="to_logout.php?">退出登录</a><br></h3>
<h1 id="title">
    <?php
    session_start();
    function query_sql($sql_txt,$index){
        $conn=mysqli_connect('127.0.0.1','root','123456','tpp');
        $result=mysqli_query($conn,$sql_txt);
        $info=mysqli_fetch_array($result);
        echo $info[$index];
    }
    $username=$_SESSION['username'];
//    $_SESSION['user_id']=@query_sql("select * from tpp_user_info where username='$username'",'user_id');
//    var_dump($_SESSION['user_id']);
    echo $_SESSION['username'];
    ?>，欢迎回来
</h1>
<a href="order/orders.php">查看订单</a><br>
<a href="login.php">切换账号</a>

<?php
//$is_logged=$_REQUEST['is_logged'];
//8*3600=28800
//北京时间和UTC相差8小时
@$current_time=28800+strtotime("now");
echo "<br>时间：".@date("Y-m-d H:i:s",$current_time)."<br>"
?>
当前热映：<br>
<table width="100%">
    <tr>
        <td id="1">
            <a href="http://localhost/film_details.php?film_id=1">
                <img src="picture/sdyjq9.jpeg" alt="速度与激情9" width="120px" height="150px">
                <?php
                @query_sql("select film_name from film_info where film_id=1",'film_name');
                ?>
            </a>
        </td>
        <td id="2">
            <a href="http://localhost/film_details.php?film_id=2">
                <img src="picture/lldq.jpeg" alt="流浪地球" height="147px" width="100px">
                <?php
                @query_sql("select film_name from film_info where film_id=2",'film_name');
                ?>
            </a>
        </td>
        <td id="3">
            <a href="http://localhost/film_details.php?film_id=3">
                <img src="picture/trjta3.jpeg" alt="唐人街探案3" height="152" width="102">
                <?php
                @query_sql("select film_name from film_info where film_id=3",'film_name');
                ?>
            </a>
        </td>
    </tr>
    <tr>
        <td id="4">
            <a href="http://localhost/film_details.php?film_id=4">
                <img src="picture/hhxd.jpeg" alt="红海行动" width="110" height="153">
                <?php
                @query_sql("select film_name from film_info where film_id=4",'film_name');
                ?>
            </a>
        </td>
        <td id="5">
            <a href="http://localhost/film_details.php?film_id=5">
                <img src="picture/zl2.jpeg" alt="战狼2" width="110" height="148">
                <?php
                @query_sql("select film_name from film_info where film_id=5",'film_name');
                ?>
            </a>
        </td>
        <td id="6">
            <a href="http://localhost/film_details.php?film_id=6">
                <img src="picture/qyqx.jpeg" alt="千与千寻" width="107" height="150">
                <?php
                @query_sql("select film_name from film_info where film_id=6",'film_name');
                ?>
            </a>
        </td>
    </tr>
</table>
<br>
<?php echo $_SESSION['username']?>
<a href="cancellate.php?username=<?php echo $_SESSION['username']?>">注销账号</a>
<hr>
广告位招租
</body>
</html>
<!--参考 https://blog.csdn.net/u013372487/article/details/46608823 -->